#include<stdio.h>
#include"SList.h"
#include<assert.h>
#include<stdlib.h>
void SLTNode_Push_Back(SL** phead, IntSList x)
{
	assert(phead);
	SL* New_Node=(SL*)malloc(sizeof(SL));
	if (New_Node == NULL)
	{
		perror("malloc fail::");
		return;
	}
	New_Node->data = x;
	New_Node->next = NULL;
	if (*phead== NULL)
	{
		*phead = New_Node;
		return;
	}
	SL* tail = *phead;
	while (tail->next != NULL)
	{
		tail = tail->next;
	}
	tail->next = New_Node;
}
void SLTNode_Draw(SL* phead)
{
	assert(phead);
	SL* tail = phead;
	while (tail != NULL)
	{
		printf("%d->", tail->data);
		tail = tail->next;
	}
	printf("\n");
}
void SLTNode_Push_Front(SL** phead, IntSList x)
{
	assert(phead);
	SL* New_Node = (SL*)malloc(sizeof(SL));
	if (New_Node == NULL)
	{
		perror("malloc fail::");
		return;
	}
	New_Node->data = x;
	New_Node->next = NULL;
	if (*phead == NULL)
	{
		*phead = New_Node;
		return;
	}
	New_Node->next = *phead;
	*phead = New_Node;
}